<?php
    $num = mt_rand(1,10);
    if( $num < 3 ){
        echo $num."小于3";
    } else if ( $num >= 3 and $num < 8 ){
        echo $num."大于等于3小于8";
    } else {
        echo $num."大于等于8";
    }
    echo "<br>" ;
    switch( $num ){
        case $num < 3 :
            echo $num."小于3";
            break;
        case $num >= 3 and $num < 8 :
            echo $num."大于等于3小于8";
            break;
        case $num >= 8 :
            echo $num."大于等于8";
            break;
    }
?>